import axios from 'axios'
import Vue from "vue";
import { Toast } from "vant";
Vue.use(Toast);
const http = axios.create({
    baseURL:'https://sz2115api.zf-maple.cn',
})
http.interceptors.request.use(
  function (config) {
    Toast.loading({
      message: "加载中...",
      forbidClick: true,
      // loadingType: 'spinner',
      position: "bottom",
      duration:0
    });
    return config;
  },
  function (error) {
    return Promise.reject(error);
  }
);
http.interceptors.response.use(function (response) {
    Toast.clear()
    return response;
  }, function (error) {
    return Promise.reject(error);
  });

export default http